package com.home.scheduler;

import com.home.task.impl.PolicyNewsTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @program: zx-fetch-job
 * @description:
 * @author: chenxf
 * @create: 2022-03-01 15:47
 **/
@Slf4j
@Component
public class FetchScheduler {

    @Resource
    PolicyNewsTask policyNewsTask;

    /**
     * 每天凌晨0：01分 抓取资讯订单
     * @throws Exception
     */
     @Scheduled(cron="0 39 15 * * ?")
    public synchronized void policyNewsListTask() throws Exception {
         System.out.println(" task is start");
        policyNewsTask.doPlan(log);
    }


}
